package cn.mayday.designmode.Proxy;

/**
 * @author Mayday05
 * @date 2021/1/5 20:03
 */
public class ProxyIImage implements IImage {

    private RealIImage realImage;
    private String fileName;

    public ProxyIImage(String fileName){
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if(realImage == null){
            realImage = new RealIImage(fileName);
        }
        realImage.display();
    }
}
